package com.youi.shop.config;


import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016110100783501";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCJjFb2aCEQVOcGqqIw2SBLEOgKyQz1P9nY6aXwWGnrve9T3zuioGe47lsa9ORF0jrXAmXLeeV+ramfKKqK1ckQEuGMTb/qS8nT4SFBO83ud0hvKb7gQb8at0ExZE1eX/m3ST9emdxq4Owwwue3UxkRiNmydtfBNtHdBNcrOUjqmHcf7cXvukex3If2ul68Mi9zGRLwtj1Cld3Dbb6vZquEkmK+wQYH1abzU75a72QyNhI8/c2eaVgqW5l0dG/nvqk2GymX97CyDJZ2LeiGaJHbruTwog5AEyDcg2NiVDJsT79N35Mi1isda8kurqp8Lplee7n3Ioqkb/82sK32YZl7AgMBAAECggEAFfDS9l9J1ucUKxYQ5SXdZtv9h6rmbECRKW6rz5jq3HXhtUlIo/peUTuEQNqLhy+vvxhc0IZTO0/MXN0Jxzeu6Od6Hv1P/bm1Kh0hRtyZTs6sOT85eWBDcamFtrE/PiylEr2WZCq65DmYs3aDq9SPjSJ9R2B5rhJmi5D4Gab7oKAO3huwMGD+GTMm8r8byYs34sHSYqw56TUr/q50I4Jner+PQWEA14yL+w6ta80K/8UNQY3PDuydCiB+VT1v3AOMFiO8eDixMkwyqI934CKRghgKTyaHCIZgSqbO62rBjQ/hrG7nMGc4EP35qLYB8DD6M9kM1xdWWFooo5EhzpmYMQKBgQD9L04pS3JNxSp0dUdj973svBq3mSviwpVzIddlXCh5eilCYC2b5IyxscczV5YXqF7WZhW3+DGus5sm91fIh4TkTP+8gnP4K1ZQR/AEhngzkMezP8YWdQRnoEuww/DfT4Z/iHAQzczXrIEnlo27D7/AG7CwJh98iYadOXODymFT5wKBgQCLE994TK6rEVkuJr5K0/R+tisLWezhP4Wm7MFUhsC+Fcv1+1fakwPpqIfH1IQVtsA9GRjAjyhVTd4qKDE++LQ1OKY143sqB4jyjynAKKCktFxJdtnCbpq6MIjDqDD0AS1jUghsQsIaR8Z4fHcRpzs3w+nT49CGcqpG3OuJSm4bTQKBgQCsYKTKoL92C6NYHvE4MthwcbGPBw5GGU0/Ue8g55n2+yFUO79RwE26PdvuLNfXy56mQmLPGoBY/ZfI8+YkdYAZIAOOCROEB52AkznrGtKD6TLN68GmUI1rMEvYUc+ReseL1QzXpAavYJeeqHZewd4/oZquk4YkeE3ahd8L/6I8SQKBgQCDKpX7Tk751d3G8hFMX0Ra8RH9na0T7yXs/aOERaaoX8RB1O/RnA/3odOVOq/sDrSVqwK2MQ34Df12wvtXCZZkD25qqoWxaPPW2ACnU2nWjKfxPV84ybmx2i5SYWDx795PqsF44SlRQdpELhbaFl96Q5JXHae/9Yr0VEzr6b+YjQKBgAYmJz0r+RQVaKN79Cn2ES5l7t0dPi7VN5h/gJwdzmO8h28cQWvOGfpya+mK1TZOclIFwh58VlSG0YJjJrgHbdch7WFzRWaWxSXYRj1vwpko91bnD7O2IefsmpTrdCiVbHwlQImBd8PCfHh1EVAzL9SfgVVA6Bera4UIuswUY1fr" ;

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiYxW9mghEFTnBqqiMNkgSxDoCskM9T/Z2Oml8Fhp673vU987oqBnuO5bGvTkRdI61wJly3nlfq2pnyiqitXJEBLhjE2/6kvJ0+EhQTvN7ndIbym+4EG/GrdBMWRNXl/5t0k/XpncauDsMMLnt1MZEYjZsnbXwTbR3QTXKzlI6ph3H+3F77pHsdyH9rpevDIvcxkS8LY9QpXdw22+r2arhJJivsEGB9Wm81O+Wu9kMjYSPP3NnmlYKluZdHRv576pNhspl/ewsgyWdi3ohmiR267k8KIOQBMg3INjYlQybE+/Td+TItYrHWvJLq6qfC6ZXnu59yKKpG//NrCt9mGZewIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
//    public static String notify_url = "http://c3n3940583.qicp.vip/shop-api/callBack/asynchronousAdvice";
    public static String notify_url = "http://baidu.com";
//    public static String notify_url = "http://zw.free.idcfengye.com/BeforeStore/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
//    public static String return_url = "http://c3n3940583.qicp.vip/shop-api/callBack/synchronizationAdvice";
    public static String return_url = "http://baidu.com";
//	public static String return_url = "http://zw.free.idcfengye.com/BeforeStore/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 打印log的文件路径
    public static String log_path = "F:\\log";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "BeforeStore_alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
